package com.exam.hellohass;

import android.animation.ObjectAnimator;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.view.animation.DecelerateInterpolator;
import android.widget.TextView;

public class WelcomeActivity extends Activity {

	private TextView welcomeStr;
	
	@SuppressLint("NewApi")
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.welcome_layout);
		
		welcomeStr = (TextView) findViewById(R.id.welcomeSr);

		ObjectAnimator animator = ObjectAnimator.ofFloat(welcomeStr, "alpha", 0f,1f);
		animator.setDuration(5000);
		animator.setInterpolator(new DecelerateInterpolator());
		animator.start();
		
		new Thread(new Runnable() {
			
			
			@Override
			public void run() {
				try {
					
					Thread.sleep(5000);
					Intent intent = new Intent(WelcomeActivity.this,MainActivity.class);
					startActivity(intent);
					finish();
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}).start();
		
	}
	
}
